package com.rd.student.jiaji.class2.shirui.arrtest;

import java.util.Arrays;

public class TestChooseSort {
    public static void main(String[] args) {
        int[] arr = new int[]{60, 77, 33, 55, 88, 90, 99};
        test1(arr);
        System.out.println(Arrays.toString(arr));
    }

    public static void test1(int[] arr) {

        for (int i = 0; i < arr.length; i++) {
            int minNumber = i;

            for (int j = i; j < arr.length; j++) {
                if (arr[j] < arr[minNumber]) {
                    minNumber = j;
                }
            }
            if (minNumber!= i) {
                int temp = arr[i];
                arr[i] = arr[minNumber];
                arr[minNumber] = temp;
//            System.out.println(Arrays.toString(arr));
            }
        }

    }
}
